#ifndef _CPP_STORY_LANGUAGE_H_
#define _CPP_STORY_LANGUAGE_H_

#include <string>
#include <map>
#ifdef WIN32
#include "cppstory_win32.h"
#endif

namespace CppStory
{

typedef enum
{
    LST_FEATURE = 0,
    LST_IN_ORDER,
    LST_AS,
    LST_I_WANT,
    LST_SCENARIO,
    LST_BACKGROUND,
    LST_GIVEN,
    LST_AND,
    LST_WHEN,
    LST_THEN,
    LST_BUT
} LANGUAGE_STR_TYPE;

typedef struct
{
    LANGUAGE_STR_TYPE type;
    std::string str;
} LanguageStrItem;

#ifdef WIN32
class CPPSTORY_WIN32_API Language
#else
class Language
#endif
{
public:
    static Language* instance();

    const char* get_feature_str();
    const char* get_in_order_str();
    const char* get_as_str();
    const char* get_i_want_str();

    const char* get_scenario_str();

    const char* get_background_str();

    const char* get_given_str();
    const char* get_and_str();
    const char* get_when_str();
    const char* get_then_str();
    const char* get_but_str();

    void register_items(const char* lang, LanguageStrItem* items);
    void set_language(const char* lang);
private:
    Language();
    LanguageStrItem* get_items(const char* language);
    std::map <std::string, LanguageStrItem*> language_items;
    std::string language;
};

class LanguageHelper
{
public:
    LanguageHelper(const char* lang, LanguageStrItem* items) { Language::instance()->register_items(lang, items); }
};

}

#endif

